<head>

    <link href="${ctx}/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet">
    <link href="${ctx}/font-awesome/3.0.0/css/font-awesome.min.css" rel="stylesheet">
    <link href="${ctx}/css/index.css" rel="stylesheet">
    <link href="${ctx}/bootstrap-table/1.12.0/bootstrap-table.min.css" rel="stylesheet">
    <script src="${ctx}/jquery/2.1.4/jquery.min.js"></script>
    <script src="${ctx}/bootstrap/3.3.7/js/bootstrap.min.js"></script>
    <script src="${ctx}/bootstrap-table/1.12.0/bootstrap-table.min.js"></script>
    <script src="${ctx}/bootstrap-table/1.12.0/locale/bootstrap-table-zh-CN.min.js"></script>
    <script src="${ctx}/bootstrap-table/1.12.0/extensions/export/bootstrap-table-export.min.js"></script>
    <script src="${ctx}/js/extends.js"></script>
    <script src="${ctx}/layui/layui.all.js"></script>
    <script src="${ctx}/js/util.js"></script>
    <link href="${ctx}/layui/css/layui.css" rel="stylesheet">
</head>
<body>
<br><br>
    <div>男           <b style="margin-left: 140px;">${cencesIdentityCard.men}</b>  <b id="men" style="margin-left: 100px;"></b></div>
    <br><div>女       <b style="margin-left: 140px;">${cencesIdentityCard.women}</b> <b id="women" style="margin-left: 100px;"></b></div>
    <br><div>12岁以下  <b style="margin-left: 100px;">${cencesIdentityCard.twelf}</b> <b id="twelf" style="margin-left: 100px;"></b></div>
    <br><div>12-14岁 <b style="margin-left: 100px;">${cencesIdentityCard.forteen}</b> <b id="forteen" style="margin-left: 100px;"></b></div>
    <br><div>15-17岁 <b style="margin-left: 100px;">${cencesIdentityCard.seventeen}</b> <b id="seventeen" style="margin-left: 100px;"></b></div>
    <br><div>18-22岁 <b style="margin-left: 100px;">${cencesIdentityCard.twentyTwo}</b> <b id="twentyTwo" style="margin-left: 100px;"></b></div>
    <br><div>23-26岁 <b style="margin-left: 100px;">${cencesIdentityCard.twentySix}</b> <b id="twentySix" style="margin-left: 100px;"></b></div>
    <br><div>27-30岁 <b style="margin-left: 100px;">${cencesIdentityCard.thrity}</b> <b id="thrity" style="margin-left: 100px;"></b></div>
    <br><div>31-40岁 <b style="margin-left: 100px;">${cencesIdentityCard.forty}</b> <b id="forty" style="margin-left: 100px;"></b></div>
    <br><div>40岁以上 <b style="margin-left: 100px;">${cencesIdentityCard.fortyPlus}</b> <b id="fortyPlus" style="margin-left: 100px;"></b></div>

    <br>
    <br>
    <div>总人数 <b style="margin-left: 120px;"></b>${cencesIdentityCard.total}</div>




<script>

    $(document).ready(function () {
        $("#men").append(GetPercent(${cencesIdentityCard.men},${cencesIdentityCard.total}));
        $("#women").append(GetPercent(${cencesIdentityCard.women},${cencesIdentityCard.total}));
        $("#twelf").append(GetPercent(${cencesIdentityCard.twelf},${cencesIdentityCard.total}));
        $("#forteen").append(GetPercent(${cencesIdentityCard.forteen},${cencesIdentityCard.total}));
        $("#seventeen").append(GetPercent(${cencesIdentityCard.seventeen},${cencesIdentityCard.total}));
        $("#twentyTwo").append(GetPercent(${cencesIdentityCard.twentyTwo},${cencesIdentityCard.total}));
        $("#twentySix").append(GetPercent(${cencesIdentityCard.twentySix},${cencesIdentityCard.total}));
        $("#thrity").append(GetPercent(${cencesIdentityCard.thrity},${cencesIdentityCard.total}));
        $("#forty").append(GetPercent(${cencesIdentityCard.forty},${cencesIdentityCard.total}));
        $("#fortyPlus").append(GetPercent(${cencesIdentityCard.fortyPlus},${cencesIdentityCard.total}));
    });


    function GetPercent(num, total) {
        /// <summary>
        /// 求百分比
        /// </summary>
        /// <param name="num">当前数</param>
        /// <param name="total">总数</param>
        num = parseFloat(num);
        total = parseFloat(total);
        if (isNaN(num) || isNaN(total)) {
            return "-";
        }
        return total <= 0 ? "0%" : (Math.round(num / total * 10000) / 100.00) + "%";
    }


</script>
<!--/请在上方写此页面业务相关的脚本-->
</body>
</html>